package com.etalk.crm.client.fallbacks;

import com.alibaba.fastjson.JSON;
import com.etalk.crm.client.interfaces.OperateClient;
import com.etalk.crm.pojo.RecommendUsers;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import java.util.List;

/**
 * @author Jordan
 * @date 2018-02-05 17:24
 */
public class OperateClientHystrix implements OperateClient {
    private static final Logger logger= LogManager.getLogger(OperateClientHystrix.class);

    private static final String ERROR_INFO_RESULT = "调用运营产品服务失败";

    /**
     * 送小E经验
     *
     * @param personId       学员id
     * @param method         赠送渠道
     * @param recommendedUid 推荐人id
     * @return 结果
     */
    @Override
    public String addExperience(Integer personId, int method, Integer recommendedUid) {
        return null;
    }

    /**
     * 转介绍,被推荐人的状态变更
     *
     * @param fromUid 邀请人ID
     * @param toUid   被邀请人ID
     * @param status  转介绍邀请进度 1完成注册 2完成试听 3完成付费 4 30天内未退费
     * @return 结果
     */
    @Override
    public String inviteAndStatus(Integer fromUid, Integer toUid, Integer status) {
        return null;
    }
    /**
     * 打开小E
     * @param personId 学员id
     * @return 结果
     */
    @Override
    public String openE(Integer personId) {
        return null;
    }

    @Override
    public String privilegeAndHours(String uidList, Integer activityId, Integer hours, Integer isGiveGifts) {
        logger.info(ERROR_INFO_RESULT+",参与活动名单："+ JSON.toJSONString(uidList)+",活动id："+activityId+",赠送套餐课时数："+hours+",是否赠送礼品："+isGiveGifts);
        return ERROR_INFO_RESULT+",参与活动名单："+JSON.toJSONString(uidList)+",活动id："+activityId+",赠送套餐课时数："+hours+",是否赠送礼品："+isGiveGifts;
    }

    /**
     * 添加好友接口
     *
     * @param uid      学员id
     * @param friendId 好友id
     * @return 结果
     */
    @Override
    public String addFriend(int uid, int friendId) {
        logger.info(ERROR_INFO_RESULT+",添加好友接口：uid:"+uid+",好友id："+friendId);
        return ERROR_INFO_RESULT+",添加好友接口：uid:"+uid+",好友id："+friendId;
    }
}
